//
//  YLMonthlyBillCellHeader.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/25.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLMonthlyBillCellHeader.h"
#import <Masonry.h>
#import "YLGlobeHeader.h"

@interface YLMonthlyBillCellHeader ()
@property (nonatomic, weak) UILabel *leftLabel;

@property (nonatomic, weak) UILabel *rightLabel;
@end

@implementation YLMonthlyBillCellHeader

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setUp];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)setUp
{
    __weak typeof(self) weakSelf = self;
    UILabel *leftLabel = [[UILabel alloc] init];
    _leftLabel = leftLabel;
    [self addSubview:leftLabel];
    [leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf);
        make.left.mas_equalTo(weakSelf).mas_offset(15);
    }];
    leftLabel.textColor = [UIColor blackColor];
    leftLabel.font = [UIFont boldSystemFontOfSize:13.0f];
    leftLabel.text = @"持有资产详情";
    
    UILabel *rightLabel = [[UILabel alloc] init];
    _rightLabel = rightLabel;
    [self addSubview:rightLabel];
    [rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(weakSelf);
        make.right.mas_equalTo(weakSelf).mas_offset(-15);
    }];
    rightLabel.textColor = YLLOrgColor;
    rightLabel.text = @"总额：￥1200.00";
    rightLabel.font = [UIFont systemFontOfSize:13.0f];
    
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    _leftLabel.text = title;
}

- (void)setSubTitle:(NSString *)subTitle
{
    _subTitle = subTitle;
    _rightLabel.text = subTitle;
}

@end
